1. Field of the Invention
This invention relates to the field of booting computer systems. Specifically, this invention is a method, apparatus, and computer program product for debugging the operation of the boot process used to start execution of a client program (such as an operating system) within a computer.
2. Background
Most operating systems need to first be loaded into volatile memory prior to execution.
A typical computer operating system manages computer resources and provides services. For example, the operating system provides controlled access to the computer's resources (such as memory and devices). Usually, a firmware bootstrap program, stored in read-only-memory (ROM), controls a computer between the time the computer is turned on and the time the client program (such as an operating system or a secondary bootstrap program) takes control of the computer. The firmware bootstrap program is responsible for testing and initializing the computer hardware, determining the computer's configuration and devices, invoking the operating system and providing debugging facilities in case of failure.
A bootstrap process often causes a firmware program to execute to load a primary bootstrap program from a known (and reserved) location in storage (either local disk or network storage) into the computer's memory. The computer then starts execution of this primary bootstrap program. The primary bootstrap program is a very small stand-alone FCode or machine language program (for example, the primary bootstrap program on a Sun Microsystems, Inc., computer is limited to 8K bytes). Thus, its functionality is very limited. Generally, the primary bootstrap program has limited capability to use the computer's devices through FCode drivers (subsequently described in the Detailed Description) supplied with the device and to locate and load a secondary bootstrap program accessible from the boot device. The primary bootstrap program includes services that understand the file structure of the boot device. The primary bootstrap program then locates and loads a specified file from the boot device. This specified file may be a stand-alone program such as a diagnostic, an operating system, or a secondary bootstrap program. These stand-alone programs are client programs of their respective bootstrap programs.
The interaction between the client program, the FCode services, and the operating system services is complex and occurs while few system services are available to simplify debugging of the booting process. This situation is particularly true because a mixture of machine instructions and FCode instructions are being executed during the boot phase. This problem is exacerbated by the fact that the mix between FCode and machine instruction execution changes during the boot process.
Thus, the problem is that debugging the bootstrap process is difficult because of the complexity of the bootstrap process, the intermixing of execution modes, and the scarcity of debugging tools during the boot process.
One prior art approach to this problem is including debugging or tracing code within the secondary bootstrap program. However, this capability is not required in production code and if included increases the complexity of the secondary bootstrap program.
It would be advantageous to temporarily provide additional capability to the secondary bootstrap program for debugging and development purposes.